<?php
require_once '../requires.php';

header('content-type:text/html; charset=utf-8');
session_start();

if(isset($_REQUEST['sig']) && !CsrfUtil::checkSign($_REQUEST['sig'], $_SESSION['sig'])) {
	echo 'fail';
} else {
	echo 'success';
}

// remember to refresh $_SESSION
$sig = CsrfUtil::getSign();
$_SESSION['sig'] = $sig;
?>
<br />
<a href="csrf_form.php">Form</a>